package org.hry.netty.protobuf;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.SimpleChannelInboundHandler;

import java.nio.charset.StandardCharsets;

/**
 * @Desc
 * @Author houry
 * @Date 2021/2/20 15:43
 **/
public class ProtoBufTestServerHandler extends SimpleChannelInboundHandler<BarrageProto.Barrage> {


    @Override
    protected void channelRead0(ChannelHandlerContext ctx, BarrageProto.Barrage msg) throws Exception {
        System.out.println("进入了lky");
        if ("lky".equals(msg.getMsgType())) {
            System.out.println("lky--------" + msg);
        } else {
            ctx.fireChannelRead(msg);
        }
    }
}
